package com.cherrish.demo.comsumer;

import com.cherrish.demo.framework.ProxyFactory;
import com.cherrish.demo.provider.api.HelloService;

/**
 * @author cherrish
 * @time 2019-03-20 16:29
 * @name Consumer
 * @desc:
 */
public class Consumer {
    public static void main(String[] args) {
       /* HttpClient httpClient = new HttpClient();
        Invocation invocation = new Invocation(HelloService.class.getName(), "sayHello", new Object[]{"MzLiu"}, new Class[]{String.class});
        String result = httpClient.post("localhost", 8080, invocation);
        System.out.println(result);*/

       //使用动态代理
        HelloService helloService = ProxyFactory.getProxy(HelloService.class);
        String result = helloService.sayHello("Mz Liu");
        System.out.println(result);
    }
}
